@page
@{ Layout = "_LayoutHome"; }
@section Styles{
    <style>
        .el-form-item {
            margin-bottom: 0px;
        }
        body,html {
            padding: 0;
            margin: 0;
        }
    </style>
}
<div class="rounded-0 shadow p-3 bg-white sticky-top">
    <div class="fw-bolder text-center">
        <div>积分商城</div>
    </div>
</div>
<div class="p-5">
    <el-form v-on:submit.native.prevent :inline="true" :model="form">
        <el-form-item label="">
            <el-input clearable prefix-icon="el-icon-search" v-model="form.keywords" placeholder="关键字"></el-input>
        </el-form-item>
        <el-form-item label="" class="p-0 m-0">
            <el-button icon="el-icon-search" v-on:click="btnSearchClick">查 询</el-button>
            <el-button icon="el-icon-back" v-on:click="location.href=utils.getRootUrl('dashboard')">返回</el-button>
        </el-form-item>
    </el-form>
    <div v-if="total>0" class="mt-5">
        <div class="row g-5">
            <div class="col-3" v-for="gift in list">
                <div class="card h-100">
                    <div class="carousel slide">
                        <el-carousel height="200px" :interval="2000" arrow="never">
                            <el-carousel-item v-for="item in gift.coverImg" :key="item">
                                <el-image :src="item" style="height:100%;width:100%;"
                                          fit="cover"></el-image>
                            </el-carousel-item>
                        </el-carousel>
                    </div>
                    <div class="card-body d-flex flex-column gap-4">
                        <div class="d-flex flex-column gap-2">
                            <h4 class="mb-0"><a href="javascript:;" v-on:click="btnViewClick(gift)" class="text-inherit">{{ gift.name }}</a></h4>
                        </div>
                        <div class="d-flex justify-content-between">
                            <h4 class="mb-0"><i class="bi bi-database-check text-warning"></i> {{ gift.point }}</h4>
                            <div>
                                <i class="el-icon-user"></i> {{ gift.shopTotal }}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="my-5 text-center">
            <el-button class="border-0 rounded-pill" icon="el-icon-refresh-right" v-if="total>pushTotal" v-on:click="btnLoadMoreClick" :loading="loadMoreLoading">加载剩余的 {{total-pushTotal}} 条</el-button>
            <small v-else>没有更多了</small>
        </div>
    </div>
    <div class="pt-10" v-else>
        <el-empty></el-empty>
    </div>
</div>
@section Scripts{
    <script src="/sitefiles/assets/js/home/gift/gifts.js" type="text/javascript"></script>
}